/*class Tdate
{
public :
	Tdate();
	void setDate(int m = 1, int d = 1, int y = 1998);
protected:
	int month;
	int day;
	int year;
};

Tdate::Tdate()
{
	month = 1;
	day = 1;
	year = 1;
}
void Tdate::setDate(int m, int d, int y)
{
	if(m > 0 && m < 13)
		month = m;
	if(d > 0 && d < 32)
		day = d;
	if(y > 0 && y < 3000)
		year = y;
}

class Tdate
{
public:
	Tdate(int m, int d, int y);
protected:
	int month;
	int day;
	int year;
};

Tdate::Tdate()
{
	if(m > 0 && m < 13)
		month = m;
	if(d > 0 && d < 32)
		day = d;
	if(y > 0 && y < 3000)
		year = y;
}*/

class Student
{
public:
	Student(char *pName = "no name", int ssId = 0)
	{
		id = ssId;
		strcpy(name, pName);
		cout << "constructing new student " << " " << pName << endl;
	}
	Student(Student &s)
	{
		cout << "constructing copy of" << " " << s.name << endl;
		strcpy(name, "copy of");
		strcat(name, s.name);
		id = s.id;
	}
	~Student()
	{
		cout << "Destructing" << " " << name << endl;
	}
protected:
	char name[20];
	int id;
};

void fn(Student s)
{
	cout << "In function fn() " << endl;
}

class xiao
{
	  int static add(int a)
	{
		//age = 34;
		return a;
	}
protected:
	static int age;
};

int xiao::age = 10;

class Base
{
public :
	virtual void fn()
	{
		cout << "In Base class " << " " << endl;
	}
};

class SubClass:public Base
{
public:
	virtual void fn()
	{
		cout << "In SubClass" << " " << endl;
	}
};

void test(Base &b)
{
	b.fn();
}